package com.h1909d.weinfo.model;

import com.h1909d.weinfo.base.BaseModel;
import com.h1909d.weinfo.bean.HotBean;
import com.h1909d.weinfo.bean.SectionsBean;
import com.h1909d.weinfo.net.HttpUtil;
import com.h1909d.weinfo.net.ResultCallBack;
import com.h1909d.weinfo.net.RxUtils;

import io.reactivex.subscribers.ResourceSubscriber;

public class HotModel extends BaseModel {
    public void getLasteHot(final ResultCallBack<HotBean>callBack){

        HttpUtil.getInstance()
                .getmHotServer()
                .getLatesHot()
                .compose(RxUtils.<HotBean>rxSchedulerHelper())
                .subscribeWith(new ResourceSubscriber<HotBean>() {
                    @Override
                    public void onNext(HotBean hotBean) {
                        callBack.onSuccess(hotBean);
                    }

                    @Override
                    public void onError(Throwable t) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }
}